package com.wanmait.employment.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wanmait.employment.entity.WorkExperience;
import com.wanmait.employment.mapper.WorkExperienceMapper;
import com.wanmait.employment.service.WorkExperienceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WorkExperienceServiceImpl implements WorkExperienceService {
    @Resource
    private WorkExperienceMapper workExperienceMapper;

    @Override
    public List<WorkExperience> selectList(String title) {
        QueryWrapper<WorkExperience> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("title",title);
        List<WorkExperience> workExperiences = workExperienceMapper.selectList(queryWrapper);
        return workExperiences;
    }

    @Override
    public Integer update(WorkExperience workExperience) {
        return workExperienceMapper.updateById(workExperience);
    }

    @Override
    public Integer insert(WorkExperience workExperience) {
        return workExperienceMapper.insert(workExperience);
    }

    @Override
    public void delete(Integer id) {
        workExperienceMapper.deleteById(id);
    }
}
